package com.uml.umlwork.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uml.umlwork.entity.CourseSelect;
import com.uml.umlwork.vo.course.select.CourseSelectVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 少枫
 * @date 2021/1/5
 */
@Mapper
@Repository
public interface CourseSelectMapper extends BaseMapper<CourseSelect> {

    /**
     * 根据条件查询选课信息及学生信息
     * @param page
     * @param eq
     * @return
     */
    Page<CourseSelectVO> getAllByCondition(IPage<CourseSelect> page, @Param(Constants.WRAPPER) Wrapper<CourseSelect> eq);

    /**
     * 根据学生ID获取学生所有选课信息
     * @param studentId 学生ID
     * @return
     */
    List<CourseSelect> getAllCourseSelects(Integer studentId);
}
